#define _CRT_SECURE_NO_WARNINGS 1

#include<iostream>
#include<vector>

using namespace std;

bool canMakeSquare(vector<vector<char>>& grid) {
    auto check = [&](int i, int j)->bool {
        int dx[4] = { 0,1,0,1 };
        int dy[4] = { 0,0,1,1 };
        int cntb = 0, cntw = 0;
        for (int k = 0; k < 4; k++)
        {
            if (grid[i + dx[k]][j + dy[k]] == 'B')   cntb++;
            else cntw++;
        }
        cout << i << " " << j << endl;
        cout << cntb << " " << cntw << endl;
        return cntb >= 3 || cntw >= 3;
    };
    for (int i = 0; i < grid.size() - 1; i++)
        for (int j = 0; j < grid[0].size() - 1; j++)
            if (check(i, j))
                return true;
    return false;
}